All Packages Class Hierarchy This Package Previous Next Index
Class sun.servlet.http.MimeHeaderField
java.lang.Object
|
+----sun.servlet.http.MimeHeaderField
- public class MimeHeaderField
- extends Object
This class is used to represent a MIME header field.
-
dateValue
- The header field Date value.
-
intValue
- The header field integer value.
-
name
- The header field name.
-
T_DATE
-
-
T_INT
-
-
T_NULL
-
-
T_STR
-
-
type
- The header field value type.
-
value
- The header field value.
-
MimeHeaderField()
- Creates a new, uninitialized header field.
-
getBytes(byte[], int)
- Put the bytes for this header into buf starting at offset buf_offset.
-
getDateValue()
- Returns the date value of the header field.
-
getIntValue()
- Returns the integer value of the header field.
-
getName()
- Returns the header field name as a String.
-
getValue()
- Returns the header field value as a String, or null if not set.
-
nameEquals(byte[], int, int)
- Returns true if the header field has the specified name.
-
nameEquals(String)
- Returns true if the header field has the specified name.
-
parse(byte[], int, int)
- Parses a header field from a subarray of bytes.
-
reset()
- Resets the header field to an uninitialized state.
-
setDateValue()
- Sets the header field date value to the current time.
-
setDateValue(long)
- Sets the header field date value to the specified time.
-
setIntValue(int)
- Sets the header field to the specified integer value.
-
setName(byte[], int, int)
- Sets the header field name to the specified subarray of bytes.
-
setName(String)
- Sets the header field name to the specified string.
-
setValue(byte[], int, int)
- Sets the header field value to the specified subarray of bytes.
-
setValue(String)
- Sets the header field value to the specified string.
-
toString()
- Returns a string representation of the header field.
-
write(ServletOutputStream)
- Writes this header field to the specified servlet output stream.
name
protected final MessageString name
- The header field name.
value
protected final MessageString value
- The header field value.
intValue
protected int intValue
- The header field integer value.
dateValue
protected final HttpDate dateValue
- The header field Date value.
type
protected int type
- The header field value type.
T_NULL
protected static final int T_NULL
T_STR
protected static final int T_STR
T_INT
protected static final int T_INT
T_DATE
protected static final int T_DATE
MimeHeaderField
public MimeHeaderField()
- Creates a new, uninitialized header field.
reset
public void reset()
- Resets the header field to an uninitialized state.
setName
public void setName(String s)
- Sets the header field name to the specified string.
- Parameters:
- s - the header field name String
setName
public void setName(byte b[],
int off,
int len)
- Sets the header field name to the specified subarray of bytes.
- Parameters:
- b - the header field name bytes
- off - the start offset of the bytes
- len - the length of the bytes
setValue
public void setValue(String s)
- Sets the header field value to the specified string.
- Parameters:
- s - the header field value String
setValue
public void setValue(byte b[],
int off,
int len)
- Sets the header field value to the specified subarray of bytes.
- Parameters:
- b - the header field value bytes
- off - the start offset of the bytes
- len - the length of the bytes
setIntValue
public void setIntValue(int i)
- Sets the header field to the specified integer value.
- Parameters:
- i - the header field integer value
setDateValue
public void setDateValue(long t)
- Sets the header field date value to the specified time.
- Parameters:
- t - the time in milliseconds since the epoch
setDateValue
public void setDateValue()
- Sets the header field date value to the current time.
getName
public String getName()
- Returns the header field name as a String.
getValue
public String getValue()
- Returns the header field value as a String, or null if not set.
getIntValue
public int getIntValue() throws NumberFormatException
- Returns the integer value of the header field.
- Throws: NumberFormatException
- if the integer format was invalid
getDateValue
public long getDateValue() throws IllegalArgumentException
- Returns the date value of the header field.
- Returns:
- the header date value in number of milliseconds since the epoch
- Throws: IllegalArgumentException
- if the date format was invalid
getBytes
public int getBytes(byte buf[],
int buf_offset)
- Put the bytes for this header into buf starting at offset buf_offset.
- Returns:
- the length of what was added
parse
public void parse(byte b[],
int off,
int len) throws IllegalArgumentException
- Parses a header field from a subarray of bytes.
- Parameters:
- b - the bytes to parse
- off - the start offset of the bytes
- len - the length of the bytes
- Throws: IllegalArgumentException
- if the header format was invalid
write
public void write(ServletOutputStream out) throws IOException
- Writes this header field to the specified servlet output stream.
nameEquals
public boolean nameEquals(String s)
- Returns true if the header field has the specified name. Character
case is ignored in the comparison.
- Parameters:
- s - the string to compare
nameEquals
public boolean nameEquals(byte b[],
int off,
int len)
- Returns true if the header field has the specified name. Character
case is ignored in the comparison.
- Parameters:
- b - the bytes to compare
- off - the start offset of the bytes
- len - the length of the bytes
toString
public String toString()
- Returns a string representation of the header field.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index